{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "969cba50",
   "metadata": {},
   "outputs": [],
   "source": [
    "from ChessUI.ChessUI import ChessUI"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ca3e3098",
   "metadata": {},
   "outputs": [],
   "source": [
    "state = [[0 for j in range(0, 9)] for i in range(0,9)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "ceca3b26",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0]]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "state"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "97a62886",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Connecting: (127.0.0.1, 16520)\n"
     ]
    }
   ],
   "source": [
    "ui = ChessUI(9, 9)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "f8cea105",
   "metadata": {},
   "outputs": [],
   "source": [
    "state[2][3] = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "e4f111a3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 1, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0]]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "state"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "cc9ddfbd",
   "metadata": {},
   "outputs": [],
   "source": [
    "ui.SetState(state)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "71552838",
   "metadata": {},
   "outputs": [],
   "source": [
    "state[2][3] = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "a2d9eec6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0],\n",
       " [0, 0, 0, 0, 0, 0, 0, 0, 0]]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "state"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "f6389c23",
   "metadata": {},
   "outputs": [],
   "source": [
    "ui.SetState(state)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "e333d253",
   "metadata": {},
   "outputs": [],
   "source": [
    "i, j = ui.GetAction()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "e8baafed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5, 4)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "i, j"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
